← Back to issue list

snapcraft.yaml does not allow WatchdogSec for systemd services

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1794814
Type
issue
State
open
Author
~presto88
Labels
Created
2018-09-27 15:14:30.628644+00:00
Updated
2018-10-01 14:00:45.744433+00:00
Closed

Current evaluation

No evaluation has been recorded for this issue yet.

Issue body

Snapcraft allows a "daemon: notify" type which enables the watchdog feature of systemd. However, systemd will not enable the watchdog feature unless the systemd service field "WatchdogSec=x"is present with a non-zero value. The default value if the field is not specified is 0, thus the watchdog feature is disabled. This means that the daemon: notify type is not working at all. I have a daemon process that uses the notify mechanism by sending "WATCHDOG=1" via sd_notify as described in the systemd documentation, https://www.freedesktop.org/software/systemd/man/systemd.service.html When I stop sending the WATCHDOG=1 message, the service should restart automatically. However, it does not restart because the WatchdogSec value has not been provided. Recommendation is to add: watchdog-sec: 5 (example) to snapcraft.yaml which will then generate "WatchDogSec=5" in the [Service] section of the systemd .service file for the snap.

Evaluation history

No evaluation history available.